package com.lagou.homework.moduletwo.first;

/*
 * @className Coder
 * @description 程序员类
 * @author admin
 * @date 2022/3/19 18:41
 * */
public class Coder {
    // 定义程序员类的特征
    private String name;
    private String id;
    private int salary;

    // 无参构造方法
    public Coder() {
    }

    // 有参构造方法
    public Coder(String name, String id, int salary) {
        setName(name);
        setId(id);
        setSalary(salary);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    // 自定义成员方法：工作
    public void work() {
        System.out.println("工号为" + getId() + "基本工资为" + getSalary() + "的程序员" + getName() + "正在努力的写着代码......");
    }
}
